(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
minus(X, s(Y)) → pred(minus(X, Y))
minus(X, 0) → X
pred(s(X)) → X
le(s(X), s(Y)) → le(X, Y)
le(s(X), 0) → false
le(0, Y) → true
gcd(0, Y) → 0
gcd(s(X), 0) → s(X)
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X))
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
minus(X, s(Y)) →+ pred(minus(X, Y))
gives rise to a decreasing loop by considering the right hand sides subterm at position [0].
The pumping substitution is [Y / s(Y)].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
minus(X, s(Y)) → pred(minus(X, Y))
minus(X, 0') → X
pred(s(X)) → X
le(s(X), s(Y)) → le(X, Y)
le(s(X), 0') → false
le(0', Y) → true
gcd(0', Y) → 0'
gcd(s(X), 0') → s(X)
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X))
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
minus(X, s(Y)) → pred(minus(X, Y))
minus(X, 0') → X
pred(s(X)) → X
le(s(X), s(Y)) → le(X, Y)
le(s(X), 0') → false
le(0', Y) → true
gcd(0', Y) → 0'
gcd(s(X), 0') → s(X)
gcd(s(X), s(Y)) → if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) → gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) → gcd(minus(Y, X), s(X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
minus,
le,
gcdThey will be analysed ascendingly in the following order:
minus < gcd
le < gcd
(8) Obligation:
TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
The following defined symbols remain to be analysed:
minus, le, gcd
They will be analysed ascendingly in the following order:
minus < gcd
le < gcd
(9) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol minus.
(10) Obligation:
TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
The following defined symbols remain to be analysed:
le, gcd
They will be analysed ascendingly in the following order:
le < gcd
(11) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
le(
gen_s:0'3_0(
+(
1,
n1635_0)),
gen_s:0'3_0(
n1635_0)) →
false, rt ∈ Ω(1 + n1635
0)
Induction Base:
le(gen_s:0'3_0(+(1, 0)), gen_s:0'3_0(0)) →RΩ(1)
false
Induction Step:
le(gen_s:0'3_0(+(1, +(n1635_0, 1))), gen_s:0'3_0(+(n1635_0, 1))) →RΩ(1)
le(gen_s:0'3_0(+(1, n1635_0)), gen_s:0'3_0(n1635_0)) →IH
false
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(12) Complex Obligation (BEST)
(13) Obligation:
TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
le(gen_s:0'3_0(+(1, n1635_0)), gen_s:0'3_0(n1635_0)) → false, rt ∈ Ω(1 + n16350)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
The following defined symbols remain to be analysed:
gcd
(14) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol gcd.
(15) Obligation:
TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
le(gen_s:0'3_0(+(1, n1635_0)), gen_s:0'3_0(n1635_0)) → false, rt ∈ Ω(1 + n16350)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
No more defined symbols left to analyse.
(16) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
le(gen_s:0'3_0(+(1, n1635_0)), gen_s:0'3_0(n1635_0)) → false, rt ∈ Ω(1 + n16350)
(17) BOUNDS(n^1, INF)
(18) Obligation:
TRS:
Rules:
minus(
X,
s(
Y)) →
pred(
minus(
X,
Y))
minus(
X,
0') →
Xpred(
s(
X)) →
Xle(
s(
X),
s(
Y)) →
le(
X,
Y)
le(
s(
X),
0') →
falsele(
0',
Y) →
truegcd(
0',
Y) →
0'gcd(
s(
X),
0') →
s(
X)
gcd(
s(
X),
s(
Y)) →
if(
le(
Y,
X),
s(
X),
s(
Y))
if(
true,
s(
X),
s(
Y)) →
gcd(
minus(
X,
Y),
s(
Y))
if(
false,
s(
X),
s(
Y)) →
gcd(
minus(
Y,
X),
s(
X))
Types:
minus :: s:0' → s:0' → s:0'
s :: s:0' → s:0'
pred :: s:0' → s:0'
0' :: s:0'
le :: s:0' → s:0' → false:true
false :: false:true
true :: false:true
gcd :: s:0' → s:0' → s:0'
if :: false:true → s:0' → s:0' → s:0'
hole_s:0'1_0 :: s:0'
hole_false:true2_0 :: false:true
gen_s:0'3_0 :: Nat → s:0'
Lemmas:
le(gen_s:0'3_0(+(1, n1635_0)), gen_s:0'3_0(n1635_0)) → false, rt ∈ Ω(1 + n16350)
Generator Equations:
gen_s:0'3_0(0) ⇔ 0'
gen_s:0'3_0(+(x, 1)) ⇔ s(gen_s:0'3_0(x))
No more defined symbols left to analyse.
(19) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
le(gen_s:0'3_0(+(1, n1635_0)), gen_s:0'3_0(n1635_0)) → false, rt ∈ Ω(1 + n16350)
(20) BOUNDS(n^1, INF)